import{_ as n}from"./index.vue_vue_type_style_index_0_lang5.js";import u from"./dropWrap.js";import{P as _}from"./prism.js";import{d as c,e as i,r as p,o as m,n as k,P as y,Q as h,$ as l,K as d,X as v,R as t,S as b,a5 as f}from"./elementPlusModules.js";import"./index.js";import"./vxeTableModules.js";import"./lodashModules.js";const D=t("p",null,"点击选中激活项",-1),g=t("p",null,"change 事件监听激活后的筛选数据",-1),V={class:"language-js"},N=c({__name:"statCard",setup(S){const r=i(`
<template>
  <MerakStatCard
    v-model="state.statValue"
    :data="state.statData"
    @change="
      params => {
        console.log(params);
      }
    "
  />
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";

import MerakStatCard, { MerakStatDataType } from "../../../../components/MerakStatCard";

const state = reactive<{
  statValue: string;
  statData: MerakStatDataType[][];
}>({
  statValue: "",
  statData: []
});

const queryStatData = () => {
  // 获取数据，组件接收指定数据，key 为指定的翻译 key
  state.statData = [
    [
      {
        key: "job",
        label: "在职",
        value: "383",
        search_key: "status",
        search_val: "1"
      },
      {
        key: "full_time",
        label: "全职",
        value: "378",
        search_key: "job_nature",
        search_val: "1,0"
      },
      {
        key: "intern",
        label: "实习生",
        value: "1",
        search_key: "job_nature",
        search_val: "1,1"
      }
    ],
    [
      {
        key: "leave_the_job",
        label: "试用期",
        value: "64",
        search_key: "status",
        search_val: "0"
      },
      {
        key: "probation_period",
        label: "待离职",
        value: "115",
        search_key: "status",
        search_val: "3"
      }
    ]
  ];
  // 如需默认激活某个筛选项需指定
  state.statValue = state.statData[0][0].key
};

onMounted(() => queryStatData());
<\/script>
`),a=p({statValue:"",statData:[]}),o=()=>{a.statData=[[{key:"job",label:"在职",value:"383",search_key:"status",search_val:"1"},{key:"full_time",label:"全职",value:"378",search_key:"job_nature",search_val:"1,0"},{key:"intern",label:"实习生",value:"1",search_key:"job_nature",search_val:"1,1"}],[{key:"leave_the_job",label:"试用期",value:"64",search_key:"status",search_val:"0"},{key:"probation_period",label:"待离职",value:"115",search_key:"status",search_val:"3"}]],a.statValue=a.statData[0][0].key};return m(()=>o()),k(()=>{_.highlightAll()}),(j,e)=>(y(),h(f,null,[D,g,l(d(n),{modelValue:a.statValue,"onUpdate:modelValue":e[0]||(e[0]=s=>a.statValue=s),data:a.statData,onChange:e[1]||(e[1]=s=>{console.log(s)})},null,8,["modelValue","data"]),l(u,{key:"oreo"},{default:v(()=>[t("pre",null,[t("code",V,b(r.value)+" ",1)])]),_:1})],64))}});export{N as default};
